﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Serialization;

namespace WebUI.Models
{
    public class MappingFileModel
    {
        public string ProcessName { get; set; }
        public string SubProcessName{ get; set; }
        public string Periodicy { get; set; }
        public string Responsible { get; set; }
        public DateTime EndTime { get; set; }
        public Status Status { get; set; }
        public DateTime ExecutedAt { get; set; }
        public DateTime DeadLine { get; set; }

        public int GetDayByPeriodicity()
        {
            switch (Periodicy)
            {
                case "Monthly":
                    return 30;
                case "Weekly":
                    return 7;
                default:
                    return 1;
            }
        }
    }

    public class ResultProcess
    {
        [XmlArray("Processes")]
        [XmlArrayItem("Process")]
        public List<MappingFileModel> Processes { get; set; }
    }

    public enum Status
    {
       Executed, Failed, Waiting, OnLate
    }
}